package com.zuul.fallback;

import org.springframework.cloud.netflix.zuul.filters.route.FallbackProvider;
import org.springframework.http.client.ClientHttpResponse;
import org.springframework.stereotype.Component;

/**
 * service-consumer服务熔断
 * 
 * @author zincredible
 * @date 2019-07-12 14:46:14
 *
 */
@Component
public class ProviderServiceFallback implements FallbackProvider {
	@Override
	public String getRoute() {
		return "service-consumer";
	}

	@Override
	public ClientHttpResponse fallbackResponse(String route, Throwable cause) {
		return new CommonClientHttpResponse(getRoute());
	}
}
